<%@codepage="65001"%>
<%session.codepage="65001"%>
<!-- #include virtual=/inc/dbConn.asp -->
<!-- #include virtual=/inc/function.asp -->
<%
	userId = Request.Cookies("S_uid")
	If Request.Cookies("S_uid") = "" Then 
		Response.write "<META http-equiv='Content-Type' content='text/html; charset=utf-8'>"
		Response.write "<meta http-equiv='Cache-Control' content='no-cache'>"
		Response.write "<meta http-equiv='Pragma' content='no-cache'>"
		Response.write "<script> alert(""비정상적으로 접속 하셨습니다."");window.close();</script>"
		response.end
	End If 
	
	xMode  = Request("xMode")	
	seq 		= Request("seq")
	mode 	= Request("m")

	'## ■■ 수정 또는 전달시 해당 정보 가져오기 ■■■■
	If seq <> "" Then
		workSql = "SELECT * FROM tblFreeBoard WHERE seq=" & seq
		Set workRs=Server.CreateObject("ADODB.RecordSet")
		workRs.open workSql, DbCon

		title = workRs("titles")
		context = workRs("contents")
		noticeFlag = workRs("noticeFlag")
		isFile = workRs("files")

	End If 
	If mode = "pass" Then
		seq = ""
	End If 

%>	
<!-- #include virtual=/inc/header_cross.inc.asp -->  

<script language="javascript">
	var G_userAll = '<%=userAll%>'; //유저 콤보 전역변수로 받기
	var G_equip = '<%=equips%>';	//장비 콤보 전역변수로 받기
	
    $(window).load(function(){
    	//$("[name=subjects]").val("안녕하세요??");
    	//$("[name=endDt]").val("<%=date()%>");
    }); 
    
		 $(document).ready(function() {
			  var clareCalendar = {
			   monthNamesShort: ['1월','2월','3월','4월','5월','6월','7월','8월','9월','10월','11월','12월'],
			   dayNamesMin: ['일','월','화','수','목','금','토'],
			   weekHeader: 'Wk',
			   dateFormat: 'yy-mm-dd',														// 날짜형식(2012-03-03)
			   autoSize: false,																	//자동리사이즈(false 이면 상위 정의에 따름)
			   changeMonth: true,															// true이면 월변경, false이면 월변경못함
			   changeYear: true,																// true이면 년변경, false이면 년변경못함
			   showMonthAfterYear: true,													//년 뒤에 월 표시
			   buttonImageOnly: true,														//이미지표시
			   //buttonText: '달력선택',														//버튼 텍스트 표시
			   //buttonImage: '/calendar.gif',												//이미지주소
			   //showOn: "both",																//엘리먼트와 이미지 동시 사용(both,button)
			   yearRange: 'c-99:c+99',													//1990년부터 2020년까지
			   maxDate: '+2Y',																	// 오늘부터6년후날짜까지만, '+0d' 오늘 이전 날짜만 선택
			   minDate: '-5y'
			  };
			  $("#endDt").datepicker(clareCalendar);
			  $("img.ui-datepicker-trigger").attr("style","margin-left:5px; vertical-align:middle; cursor:pointer;"); //이미지버튼 style적용
			  $("#ui-datepicker-div").hide(); //자동으로 생성되는 div객체 숨김  
		});
</script>
 </HEAD>
<BODY topmargin="0" leftmargin="0">
<table border="0" cellpadding="0" cellspacing="0" style="width:800px;margin-bottom:10px;">
	<tr height="26">
		<td width="100%" class="lTD_00b0" background="/inc/layout/panel-title-light-bg.gif"><b>&nbsp; &nbsp; 자유게시판</b></td>
	</tr>  
</table>

<table border="0" cellpadding="0" cellspacing="0" style="width:800px">
<tr>
	<td style="text-align:center; padding: 15px 0 15px 0">
		<table border="0" cellpadding="0" cellspacing="0" width="770">
			<form name="frmWorkBbs" action="/action/groupBbsWrite/save.asp" method="post" ENCTYPE="multipart/form-data">
			<input type="hidden" name="seq" value="<%=seq%>">
			<input type="hidden" name="sender" value="<%=userId%>">
			<input type="hidden" name="isFile" value="<%=isFile%>">
			<tr height="30">
				<td width="10" class="lTD_t00l">&nbsp;</td>
				<td width="750" colspan="3" class="lTD_t000" style="text-align:left;padding-left:15px; font-weight:bold; height:28px">
				제 목 &nbsp; &nbsp; &nbsp;<input type="text" name="subjects" value="<%=title%>" style="width:455px" class="inputBox"> &nbsp; <input type="checkbox" <% If noticeFlag="Y" Then Response.write "checked" End If %> name="noticeFlag" value="Y" class="chkbox"><label>공지사항</label>
				</td>							
				<td width="10" class="lTD_tr00">&nbsp;</td>
			</tr>
			<tr height="30">
				<td width="10" class="lTD_t00l">&nbsp;</td>
				<td width="750" colspan="3" class="lTD_t0b0" style="text-align:left;padding-left:15px; font-weight:bold; height:28px">
				첨 부 &nbsp; &nbsp; &nbsp;<input type="file" name="uFile" style="width:400px" class="inputBox"> &nbsp; <!--<input type="button" class="inputBtn" value="파일첨부" onclick="ajaxFileUpload('Y')">-->
				</td>							
				<td width="10" class="lTD_tr00">&nbsp;</td>
			</tr>
			<% If isFile <> "" Then %>
			<tr height="30">
				<td width="10" class="lTD_000l">&nbsp;</td>
				<td width="750" colspan="3" class="lTD_00b0" style="padding-left:15px; font-weight:bold;text-align:left;">
				첨부파일 &nbsp; : &nbsp; &nbsp;<a href="/files/<%=isFile%>" target="_blank"><%=isFile%></a>
				</td>							
				<td width="10" class="lTD_0r00">&nbsp;</td>
			</tr>
			<%	End If %>
			<tr height="30">
				<td width="10" class="lTD_000l">&nbsp;</td>
				<td width="672" colspan="3" class="lTD_00b0" align="center" style="padding : 5px 0 5px 0;">
<!--				<textarea name="context" id="context" rows="21" cols="105"><%=context%></textarea>-->
<!-- #include virtual="/EditorFck/fckeditor.asp" -->
<%
				 Dim oFCKeditor

				 Set oFCKeditor = New FCKeditor
				 oFCKeditor.ToolbarSet = "Jadesoft"
				 oFCKeditor.BasePath = "/EditorFck/" 
				 oFCKeditor.Width = "740"
				 oFCKeditor.Height = "400"
				 oFCKeditor.Value = context 
				 oFCKeditor.Create "context"
%>
				</td>							
				<td width="10" class="lTD_0r00">&nbsp;</td>
			</tr>
			<tr height="30">
				<td width="100%" colspan="5" class="lTD_0rbl">
					<table border="0" width="100%">
						<tr>
							<td style="text-align:left">&nbsp; &nbsp;<input type="button" onClick="window.close()" value="닫 기" class="inputBtn"></td>
							<td style="text-align:right">&nbsp;<input type="button" value="저 장" class="inputBtn" onClick="fnSave()" id="btnSave"><span id="showSaving"></span> &nbsp;<input type="button" onClick="fnReset()" value="신 규" class="inputBtn">&nbsp; &nbsp;</td>
						</tr>
					</table>
				</td>
			</tr>
			</form>
		</table>		
	</td>
</tr>
</table>
</BODY>
</HTML>
<%session.codepage="949"%>
